﻿using AutoMapper;
using FarmSmartSleep.Common.Domain;
using FarmSmartSleep.Common.Dtos;
using FarmSmartSleep.Organ.API.Application.Commands.DepartmentCommands;
using FarmSmartSleep.Organ.API.Application.Commands.CottagesCommands;
using FarmSmartSleep.Organ.API.Application.Commands.EnterpriseCommands;
using FarmSmartSleep.Organ.API.Application.SleepInfoCommands.FemaleBeginCommands;
using FarmSmartSleep.Common.Domain.BeginTable;
using FarmSmartSleep.Organ.API.Application.SleepInfoCommands.RecordCommands;
using FarmSmartSleep.Organ.API.Application.ProductionManagement.MotherGivingBirthFile;
using FarmSmartSleep.Common.Domain.PM;
using FarmSmartSleep.Organ.API.Application.ProductionManagement.FemaleRen;
using FarmSmartSleep.Common.Domain.PM.select;
using FarmSmartSleep.Organ.API.Application.SleepWeightCommands;
using FarmSmartSleep.Common.Domain.BodyWeight;
using FarmSmartSleep.Organ.API.Application.ProductionManagement.MotherHybridizationCommands;
using FarmSmartSleep.Common.Domain.RaiseManagement;
using FarmSmartSleep.Organ.API.Application.RaiseCommands;
using FarmSmartSleep.Organ.API.Application.ProductionManagement.SheepTransferCommands;

namespace FarmSmartSleep.Organ.API.Application.AutoMapper
{
    public class AutoMapperProfile : Profile
    {
        //配置映射关系
        //用户
        public AutoMapperProfile()
        {
            //创建用户新增的映射 由 新增用户的入参 转换为  用户实体

            //CreateMap<Users, userDto>().reverseMap();
            // .ReverseMap();的作用 自动推导出反向映射规则

            CreateMap<DepartmentCreateCommand, Departments>().ReverseMap();

            CreateMap<EnterpriseTypeListCommand, Province>().ReverseMap();//省

            CreateMap<EnterprisecityListResponsetModel, City>().ReverseMap();//市

            CreateMap<EnterpriseproviceListsResponsetModel, County>().ReverseMap();//县

            CreateMap<IndustryLabelsTypeListCommand, IndustryLabels>().ReverseMap();//行业一级

            CreateMap<IndustryListResponsetModel, Industry>().ReverseMap();//行业二级

            CreateMap<FemaleRenResultListCommand, PregnancyTests>().ReverseMap();//妊检结果

            CreateMap<FemaleRenWayListCommand, PregnancyCheckMethod>().ReverseMap();//妊检方式

            CreateMap<EnterpriseSelectCommand, Enterprise>().ReverseMap();//企业

            CreateMap<SheepInforListCommand, SleepInfor>().ReverseMap();//耳号

            CreateMap<RaiseTypeListCommand, SheepDeath>().ReverseMap();//死亡原因
            CreateMap<EliminateTypeListCommand, Culled>().ReverseMap();//淘汰原因

            //两个对象  属性名称不相同  Age==>UserAge

            //两个对象 属性 数据类型 不相同  string==>int  string==>Datetime

            //栋舍映射
            CreateMap<CottageCreateCommand, Cottages>().ReverseMap();
            CreateMap<ProBeginCreateCommand, ProBegin>().ReverseMap();
            //CreateMap<ProRecordCreateCommand,ProSleepBirth>().ReverseMap();
            CreateMap<SheepInforCommand, SleepInfor>().ReverseMap();

            /*------------------生产管理------------------------------------------------*/
            CreateMap<MotherGivingBirthCreateCommon, MotherGivingBirth>().ReverseMap();//母种分娩

            CreateMap<FemaleRenCreateCommand, EwePregnancyCheckRecord>().ReverseMap();//妊检映射

            CreateMap<SeedmaleCommand, MaleBegin>().ReverseMap();//种公映射
            CreateMap<SleepWeightCreateCommand, SleepWeight>().ReverseMap();//羊只称重表映射
            CreateMap<MotherHybridizationCreateCommand, MotherHybridization>().ReverseMap();//种母配种映射


            CreateMap<SleepWeightCreateCommand,SleepWeight>().ReverseMap();
            CreateMap<BodyMeanCreateCommand,BodyMeans>().ReverseMap();
            CreateMap<PhaseCreateCommand,PhaseDeters>().ReverseMap();

            CreateMap<SheepTransferCreateComand, SheepTransfer>().ReverseMap();//羊只转舍（添加）

            CreateMap<MotherGivingBirthUpdateCommon, MotherGivingBirth>().ReverseMap();  //分娩修改
        }
    }
}
